package io;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.nio.charset.StandardCharsets;

public class CopeDemo1 {
    public static void main(String[] args) throws Exception{
        FileInputStream fis = new FileInputStream("img.png");
        FileOutputStream fos = new FileOutputStream("img.jpg");
        int len ;
        byte[] bytes = new byte[1024 * 10];
        long start  = System.currentTimeMillis();
        while ((len = fis.read(bytes))!=-1){
            fos.write(bytes, 0, len);
        }
        long end = System.currentTimeMillis();
        System.out.println("复制完毕!用时:" + (end - start) + "ms");
        fis.close();
        fos.close();


    }
}
